1. Field of the Invention
The present invention relates to a communication processing apparatus that receives communication frames, processes the received communication frames sequentially, and transmits the processed communication frames, and more particularly relates to a communication processing apparatus to be used as an apparatus, such as a switch or a router, for use in connecting communication networks. The present invention also relates to a totalizing system for totalizing the number of frames processed by such a communication processing apparatus.
2. Description of Related Art
With the development of communication networks such as LAN, WAN, and the Internet, communication processing apparatuses such as switches and routers for use in connecting communication networks have been developed. In addition to their fundamental functions including a transfer function, a routing function, and the like, various functions, such as the function of monitoring the communication status, and the like, were proposed and realized for these communication processing apparatuses (see, for example, Japanese Patent No. 2510875).
FIG. 1 is a block diagram showing a configuration example of a conventional communication processing apparatus.
In FIG. 1, reference numeral 100 denotes a communication processing apparatus. The communication processing apparatus 100 comprises a control unit 101 for controlling the entire apparatus; a receiving unit 102, connected to a communication network, for receiving communication frames; and a transmitting unit 103 for transmitting the received communication frames. The communication frames received by the receiving unit 102 are processed by a first processing unit 1041, a second processing unit 1042 and a third processing unit 1043, and then passed to the transmitting unit 103 and transmitted from the transmitting unit 103 to an external communication network.
Processing to be performed by the first processing unit 1041, second processing unit 1042 and third processing unit 1043 is processing for realizing functions to be fundamentally executed by the communication processing apparatus, such as a transfer function, a routing function, and the like. For example, the first processing unit 1041 and third processing unit 1043 perform processing related to a layer 1 (physical layer) in an OSI reference model, and the second processing unit 1042 performs processing related to a layer 2 (data link layer).
A computer program (PG) 101a, such as firmware, is stored in the control unit 101 of the communication processing apparatus 100. When the control unit 101 executes the computer program 101a, the number of communication frames passing through the first processing unit 1041, second processing unit 1042 and third processing unit 1043 is counted and totalized.
In order to count the communication frames, the first processing unit 1041 comprises a counter 1041a, the second processing unit 1042 comprises a counter 1042a, and the third processing unit 1043 comprises a counter 1043a. The communication processing apparatus 100 comprises a database (DB) 105 for recording the totalized result of the communication frames counted by each of the processing units 1041, 1042, and 1043 when the control unit 101 executes the computer program 101a; and a timer unit 106 for measuring time.
Further, the communication processing apparatus 100 comprises a connection unit 107 for connecting the control unit 101 and an operating apparatus 200 to be operated by a maintenance person. When a request to transmit the totalized result is made from the operating apparatus 200 through the connection unit 107, the control unit 101 of the communication processing apparatus 100 transmits the totalized result to the operating apparatus 200.
FIG. 2 is a view showing the sequence of the totalizing process to be performed by the conventional communication processing apparatus 100 having the above-mentioned configuration. Note that the following processing is realized when the control unit 101 executes the computer program 101a. 
The communication processing apparatus 100 causes the timer unit 106 to measure a predetermined time to be a cycle of a periodical totalizing process. Whenever the predetermined time has passed, the timer unit 106 outputs a predetermined signal to the control unit 101 (S1). The control unit 101 starts the periodical totalizing process upon receipt of the predetermined signal. First, the control unit 101 requests transmission of the count value of the communication frames counted by the counter 1041a of the first processing unit 1041 (S2). The control unit 101 collects the count value transmitted from the first processing unit 1041 based on this request (S3), and recodes the collected count value in the database 105 (S4). Next, the control unit 101 requests transmission of the count value of the communication frames counted by the counter 1042a of the second processing unit 1042 (S5). The control unit 101 collects the count value transmitted from the second processing unit 1042 based on this request (S6), and records the collected count value in the database 105 (S7). Further, the control unit 101 requests transmission of the count value of the communication frames counted by the counter 1043a of the third processing unit 1043 (S8). The control unit 101 collects the count value transmitted from the third processing unit 1043 based on this request (S9), and recodes the collected count value in the database 105 (S10).
When the communication processing apparatus 100 is requested by the operating apparatus 200 to transmit the totalized result (S11), the control unit 101 reads the result of totalizing the count values recorded in the database 105 (S12), and transmits the read totalized result to the operating apparatus 200 (S13).
In the conventional communication processing apparatus 100 explained using FIG. 1 and FIG. 2, however, since the time required for sequentially collecting the numbers of the communication frames counted by the counters 1041a, 1042a, and 1043a of the respective processing units is longer than the time required for sequentially processing the communication frames by the first processing unit 1041, the second processing unit 1042 and the third processing unit 1043, the totalized result in each of the processing units 1041, 1042 and 1043 may have errors.
FIG. 3 to FIG. 5 are conceptual views showing the state in which communication frames are passing through the respective processing units of the conventional communication processing apparatus. In FIG. 3 to FIG. 5, the components similar to those in FIG. 1 are designated with the same reference numerals as in FIG. 1.
In FIG. 3 to FIG. 5, reference numeral F denotes communication frames that pass through the first processing unit 1041, second processing unit 1042 and third processing unit 1043, and are subjected to the predetermined processing in each possessing unit. The communication frames F positioned in the counters 1041a, 1042a and 1043a represent the communication frames that already passed through the respective processing units and counted by the respective counters. On the other hand, the communication frames F positioned outside the counters represent the communication frames that have not yet been counted.
FIG. 3 shows the state in which the result counted by the counter 1041a of the first processing unit 1041 is collected. At this time, while the number of the communication frames that pass through the communication processing apparatus 100 is 6, one frame has been counted by the counter 1041a. 
FIG. 4 shows the state of collecting the result counted by the counter 1042a of the second processing unit 1042 after Δt seconds from the time shown in FIG. 3. At this time, two frames have been counted by the counter 1042a. The reason why there is a difference between the counted result in the counter 1041a and the counted result in the counter 1042a is that the time required for the communication frames to pass through the first processing unit 1041 and the second processing unit 1042 is shorter than the time from a time at which the counted result in the counter 1041a is collected to a time at which the counted result in the counter 1042a is collected.
FIG. 5 shows the state of collecting the result counted by the counter 1043a of the third processing unit 1043 after more Δt seconds from the time shown in FIG. 4. At this time, three frames have been counted by the counter 1043a 
Accordingly, since the counted results in the first processing unit 1041, second processing unit 1042, and third processing unit 1043 are different from each other, the result of totalizing the counted results may indicate as if the number of the communication frames has increased in the communication processing apparatus 100, and thus there is a problem of controversy in the totalized result. When the counted results are collected by temporarily interrupting the process of relaying the communication frames, this problem may be solved, but it is not easy to interrupt the process of the communication processing apparatus 100 in progress.